package com.fly.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class UsersExample
{
    protected String orderByClause;
    
    protected List<Criteria> oredCriteria;
    
    public UsersExample()
    {
        oredCriteria = new ArrayList<Criteria>();
    }
    
    protected UsersExample(UsersExample example)
    {
        this.orderByClause = example.orderByClause;
        this.oredCriteria = example.oredCriteria;
    }
    
    public void setOrderByClause(String orderByClause)
    {
        this.orderByClause = orderByClause;
    }
    
    public String getOrderByClause()
    {
        return orderByClause;
    }
    
    public List<Criteria> getOredCriteria()
    {
        return oredCriteria;
    }
    
    public void or(Criteria criteria)
    {
        oredCriteria.add(criteria);
    }
    
    public Criteria createCriteria()
    {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0)
        {
            oredCriteria.add(criteria);
        }
        return criteria;
    }
    
    protected Criteria createCriteriaInternal()
    {
        Criteria criteria = new Criteria();
        return criteria;
    }
    
    public void clear()
    {
        oredCriteria.clear();
    }
    
    public static class Criteria
    {
        protected List<String> criteriaWithoutValue;
        
        protected List<Map<String, Object>> criteriaWithSingleValue;
        
        protected List<Map<String, Object>> criteriaWithListValue;
        
        protected List<Map<String, Object>> criteriaWithBetweenValue;
        
        protected Criteria()
        {
            super();
            criteriaWithoutValue = new ArrayList<String>();
            criteriaWithSingleValue = new ArrayList<Map<String, Object>>();
            criteriaWithListValue = new ArrayList<Map<String, Object>>();
            criteriaWithBetweenValue = new ArrayList<Map<String, Object>>();
        }
        
        public boolean isValid()
        {
            return criteriaWithoutValue.size() > 0 || criteriaWithSingleValue.size() > 0 || criteriaWithListValue.size() > 0 || criteriaWithBetweenValue.size() > 0;
        }
        
        public List<String> getCriteriaWithoutValue()
        {
            return criteriaWithoutValue;
        }
        
        public List<Map<String, Object>> getCriteriaWithSingleValue()
        {
            return criteriaWithSingleValue;
        }
        
        public List<Map<String, Object>> getCriteriaWithListValue()
        {
            return criteriaWithListValue;
        }
        
        public List<Map<String, Object>> getCriteriaWithBetweenValue()
        {
            return criteriaWithBetweenValue;
        }
        
        protected void addCriterion(String condition)
        {
            if (condition == null)
            {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteriaWithoutValue.add(condition);
        }
        
        protected void addCriterion(String condition, Object value, String property)
        {
            if (value == null)
            {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("condition", condition);
            map.put("value", value);
            criteriaWithSingleValue.add(map);
        }
        
        protected void addCriterion(String condition, List<? extends Object> values, String property)
        {
            if (values == null || values.size() == 0)
            {
                throw new RuntimeException("Value list for " + property + " cannot be null or empty");
            }
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("condition", condition);
            map.put("values", values);
            criteriaWithListValue.add(map);
        }
        
        protected void addCriterion(String condition, Object value1, Object value2, String property)
        {
            if (value1 == null || value2 == null)
            {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            List<Object> list = new ArrayList<Object>();
            list.add(value1);
            list.add(value2);
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("condition", condition);
            map.put("values", list);
            criteriaWithBetweenValue.add(map);
        }
        
        public Criteria andIdIsNull()
        {
            addCriterion("id is null");
            return this;
        }
        
        public Criteria andIdIsNotNull()
        {
            addCriterion("id is not null");
            return this;
        }
        
        public Criteria andIdEqualTo(Integer value)
        {
            addCriterion("id =", value, "id");
            return this;
        }
        
        public Criteria andIdNotEqualTo(Integer value)
        {
            addCriterion("id <>", value, "id");
            return this;
        }
        
        public Criteria andIdGreaterThan(Integer value)
        {
            addCriterion("id >", value, "id");
            return this;
        }
        
        public Criteria andIdGreaterThanOrEqualTo(Integer value)
        {
            addCriterion("id >=", value, "id");
            return this;
        }
        
        public Criteria andIdLessThan(Integer value)
        {
            addCriterion("id <", value, "id");
            return this;
        }
        
        public Criteria andIdLessThanOrEqualTo(Integer value)
        {
            addCriterion("id <=", value, "id");
            return this;
        }
        
        public Criteria andIdIn(List<Integer> values)
        {
            addCriterion("id in", values, "id");
            return this;
        }
        
        public Criteria andIdNotIn(List<Integer> values)
        {
            addCriterion("id not in", values, "id");
            return this;
        }
        
        public Criteria andIdBetween(Integer value1, Integer value2)
        {
            addCriterion("id between", value1, value2, "id");
            return this;
        }
        
        public Criteria andIdNotBetween(Integer value1, Integer value2)
        {
            addCriterion("id not between", value1, value2, "id");
            return this;
        }
        
        public Criteria andUsernameIsNull()
        {
            addCriterion("username is null");
            return this;
        }
        
        public Criteria andUsernameIsNotNull()
        {
            addCriterion("username is not null");
            return this;
        }
        
        public Criteria andUsernameEqualTo(String value)
        {
            addCriterion("username =", value, "username");
            return this;
        }
        
        public Criteria andUsernameNotEqualTo(String value)
        {
            addCriterion("username <>", value, "username");
            return this;
        }
        
        public Criteria andUsernameGreaterThan(String value)
        {
            addCriterion("username >", value, "username");
            return this;
        }
        
        public Criteria andUsernameGreaterThanOrEqualTo(String value)
        {
            addCriterion("username >=", value, "username");
            return this;
        }
        
        public Criteria andUsernameLessThan(String value)
        {
            addCriterion("username <", value, "username");
            return this;
        }
        
        public Criteria andUsernameLessThanOrEqualTo(String value)
        {
            addCriterion("username <=", value, "username");
            return this;
        }
        
        public Criteria andUsernameLike(String value)
        {
            addCriterion("username like", value, "username");
            return this;
        }
        
        public Criteria andUsernameNotLike(String value)
        {
            addCriterion("username not like", value, "username");
            return this;
        }
        
        public Criteria andUsernameIn(List<String> values)
        {
            addCriterion("username in", values, "username");
            return this;
        }
        
        public Criteria andUsernameNotIn(List<String> values)
        {
            addCriterion("username not in", values, "username");
            return this;
        }
        
        public Criteria andUsernameBetween(String value1, String value2)
        {
            addCriterion("username between", value1, value2, "username");
            return this;
        }
        
        public Criteria andUsernameNotBetween(String value1, String value2)
        {
            addCriterion("username not between", value1, value2, "username");
            return this;
        }
        
        public Criteria andPasswordIsNull()
        {
            addCriterion("password is null");
            return this;
        }
        
        public Criteria andPasswordIsNotNull()
        {
            addCriterion("password is not null");
            return this;
        }
        
        public Criteria andPasswordEqualTo(String value)
        {
            addCriterion("password =", value, "password");
            return this;
        }
        
        public Criteria andPasswordNotEqualTo(String value)
        {
            addCriterion("password <>", value, "password");
            return this;
        }
        
        public Criteria andPasswordGreaterThan(String value)
        {
            addCriterion("password >", value, "password");
            return this;
        }
        
        public Criteria andPasswordGreaterThanOrEqualTo(String value)
        {
            addCriterion("password >=", value, "password");
            return this;
        }
        
        public Criteria andPasswordLessThan(String value)
        {
            addCriterion("password <", value, "password");
            return this;
        }
        
        public Criteria andPasswordLessThanOrEqualTo(String value)
        {
            addCriterion("password <=", value, "password");
            return this;
        }
        
        public Criteria andPasswordLike(String value)
        {
            addCriterion("password like", value, "password");
            return this;
        }
        
        public Criteria andPasswordNotLike(String value)
        {
            addCriterion("password not like", value, "password");
            return this;
        }
        
        public Criteria andPasswordIn(List<String> values)
        {
            addCriterion("password in", values, "password");
            return this;
        }
        
        public Criteria andPasswordNotIn(List<String> values)
        {
            addCriterion("password not in", values, "password");
            return this;
        }
        
        public Criteria andPasswordBetween(String value1, String value2)
        {
            addCriterion("password between", value1, value2, "password");
            return this;
        }
        
        public Criteria andPasswordNotBetween(String value1, String value2)
        {
            addCriterion("password not between", value1, value2, "password");
            return this;
        }
    }
}